♻️(frontend) Refactor: merge cunningham - #284
Conversation
Relocate the existing UI Kit sources without changing their content. Prepare the repository for the workspace-based package layout.
Configure Yarn workspaces, Turborepo, Changesets, and shared tooling. Declare the three packages and update the monorepo lockfile.
Import the Cunningham token generator, CLI, defaults, and test suite. Preserve the historical output format and cunningham binary name.
Import Cunningham components, styles, stories, documentation, and tests. Merge shared components, locales, providers, exports, icons, and themes.
Rewrite legacy package, style, font, and icon imports from an npx command. Keep preview as the default and support explicit write and check modes.
Describe the monorepo packages, install paths, and migration command. Move release guidance under docs and define independent package versioning.
Cache workspace dependencies and run package checks through Turbo. Publish the validated Storybook artifact to GitHub Pages from main.
Track the token library sources hidden by the generic lib ignore. Build Storybook through Turbo so workspace dependencies are ready first.
jbpenrath
left a comment
There was a problem hiding this comment.
About the storybook, there is a lot of work to merge both docs and remove deprecated doc proper to initial design system
| { | ||
| files: ["packages/ui-tokens/**/*.ts"], | ||
| rules: { | ||
| "@typescript-eslint/no-explicit-any": "off", |
There was a problem hiding this comment.
I'll enable this rule. Allow any anywhere is IMO the best way to get a repo with shitty typing. There is few exceptions and in this case, we should disable the rule locally.
There was a problem hiding this comment.
Not in this PR but with all supply chain attacks we will have to setup a docker workflow for this repo.
| @@ -0,0 +1,31 @@ | |||
| # `@gouvfr-lasuite/ui-tokens` | |||
|
|
|||
| The Cunningham design-token engine, now maintained in the La Suite numérique UI | |||
There was a problem hiding this comment.
| The Cunningham design-token engine, now maintained in the La Suite numérique UI | |
| The UI Kit design-token engine, now maintained in the La Suite numérique UI |
|
|
||
| export default defineConfig({ | ||
| build: { | ||
| emptyOutDir: false, |
There was a problem hiding this comment.
Don't remember why we need that. With fresh eye it looks bad
There was a problem hiding this comment.
We have to homogenize folder name case.
IMO, I'll keep ui-kit standard
- Folder : snake-case
- Component : CamelCase
There was a problem hiding this comment.
We should also allow to migrate from @openfun/cunningham-*?
|
|
||
| ## Prerequisites | ||
|
|
||
| - Node 20 and Yarn 1.22.22; |
There was a problem hiding this comment.
Right moment to use the latest LTS node version (24)
|
I feel we lose some override nope ? (I did not found data-grid override for example) |
Summary
This PR merges Cunningham into UI Kit and turns the repository into a Yarn
monorepo with three packages:
@gouvfr-lasuite/ui-components: all UI Kit and Cunningham components.@gouvfr-lasuite/ui-tokens: the token engine, themes and generators.@gouvfr-lasuite/ui-codemod: an npx-only migration CLI.It also consolidates the documentation into a single Storybook, adds manual
release documentation and deploys Storybook to GitHub Pages after merges to
main.Testing
yarn lintyarn buildyarn testyarn test:ctSTORYBOOK_BASE_PATH=/ui-kit yarn build-storybook